# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Hussam Al-Tayeb <ht990332@gmail.com>

pkgname=xmlsec
pkgver=1.2.32
pkgrel=1
pkgdesc="XML Security Library is a C library based on LibXML2"
license=('custom')
arch=('x86_64')
url="https://www.aleksey.com/xmlsec/index.html"
depends=('libxslt' 'openssl' 'gnutls' 'nss' 'libltdl')
provides=('libxmlsec1.so' 'libxmlsec1-openssl.so' 'libxmlsec1-nss.so' 'libxmlsec1-gnutls.so' 'libxmlsec1-gcrypt.so')
#source=(https://www.aleksey.com/xmlsec/download/${pkgname}1-${pkgver}.{tar.gz,sig}) # signature file not compatible
source=(https://www.aleksey.com/xmlsec/download/${pkgname}1-${pkgver}.tar.gz)
sha256sums=('e383702853236004e5b08e424b8afe9b53fe9f31aaa7a5382f39d9533eb7c043')
#validpgpkeys=('') #

build() {
  cd ${pkgname}1-${pkgver}
  ./configure --prefix=/usr --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd ${pkgname}1-$pkgver
  make -k check
}

package() {
  cd ${pkgname}1-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}"/usr/share/licenses/${pkgname}
  install -m644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/
}
